package com.yangke.myRule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyselfRule {

    @Bean
    public IRule myRule(){
        // 添加一个随机访问的Ribbon负载均衡访问类，替换系统默认的轮循访问
        return new RandomRule();
    }
}
